<template>
  <div class="cart-list">
    <Scroll class="content" ref="scroll">
      <CartListItem v-for="(item,index1) in cartList"
                    :product="item"
                    :key="index1"/>
    </Scroll>
  </div>
</template>

<script>
  import Scroll from "../../../components/common/scroll/Scroll";

  import CartListItem from "./CartListItem";

  import {mapGetters} from "vuex"

  export default {
    name: "CartList",
    components: {
      Scroll,
      CartListItem
    },
    computed: {
      ...mapGetters(['cartList'])
    },
    activated() {
      this.$refs.scroll.refresh()
    }
  }
</script>

<style scoped>
  .cart-list {
    height: calc(100% - 44px - 49px - 44px);
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 93px;
  }

  .content {
    height: 100%;
    overflow: hidden;
  }
</style>
